/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2025-2025. All rights reserved.
 *
 * openGauss is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *
 * http://license.coscl.org.cn/MulanPSL2
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FITFOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

package org.opengauss.agent.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.List;

/**
 * TaskType
 *
 * @author: wangchao
 * @Date: 2025/4/8 16:40
 * @Description: TaskType
 * @since 7.0.0-RC2
 **/
@Getter
@AllArgsConstructor
public enum TaskType {
    OSHI_FIXED_METRIC("OSHI_FIXED_METRIC"),
    OSHI_DYNAMIC_METRIC("OSHI_DYNAMIC_METRIC"),
    OS_METRIC("OS_METRIC"),
    DB_METRIC("DB_METRIC"),
    OS_PIPE("OS_PIPE"),
    DB_PIPE("DB_PIPE");

    private String value;

    private static final List<TaskType> METRIC_TASK_TYPES = List.of(OSHI_FIXED_METRIC, OSHI_DYNAMIC_METRIC, OS_METRIC,
        DB_METRIC);

    /**
     * isOtelMetricTask
     *
     * @param taskType taskType
     * @return boolean
     */
    public static boolean isOtelMetricTask(TaskType taskType) {
        return METRIC_TASK_TYPES.contains(taskType);
    }
}
